<!DOCTYPE html>
<html>
<#assign title="后台大布局">
<#include "/util/head.ftl">

<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">后台管理系统</div>
			<!-- <ul class="layui-nav layui-layout-left">
				<li class="layui-nav-item"> 
				<@shiro.hasPermission name="developer:generator:list">
					developer:generator:list
				</@shiro.hasPermission>
				</li>
			</ul> -->
			<ul class="layui-nav layui-layout-right">
				<li class="layui-nav-item">
				<a href="javascript:;">
				<img onerror="this.src='/static/img/default_user.png'" src='<@shiro.principal property="avatar"/>' class="layui-nav-img"><@shiro.principal property="username"/>
				</a>
				</li>
				<li class="layui-nav-item"><a href="/logout.htm"><i class="layui-icon" style="font-size: 12px; color: red;">&#x1007;</i>退出</a></li>
			</ul>
		</div>

		<div class="layui-side layui-bg-black">
			<div class="layui-side-scroll">
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="test">
					<#list menus as parent>
						<#if parent.showflag=='1'>
						<li class="layui-nav-item">
							<#if (parent.url??) && (parent.url!="") >
								<a target="mainFrame" href="${parent.url!''}"><i class="layui-icon" style="font-size: 20px;margin-right: 10px">${parent.icon!''}</i>${parent.name}</a>
							<#else>
								<a href="javascript:;"><i class="layui-icon" style="font-size: 20px;margin-right: 10px">${parent.icon!''}</i>${parent.name}</a>
								<dl class="layui-nav-child">
									<#list parent.children as child>
									<#if child.showflag=='1'>
									<dd>
										<a style="margin-left: 40px" target="mainFrame" href="${child.url!''}">${child.name}</a>
									</dd>
									</#if>
									</#list>
								</dl>
							</#if>
						</li>
						</#if>
					</#list>
				</ul>
			</div>
		</div>

		<div class="layui-body" id="main_body">
			<div id="main_content" style="padding: 5px;">
				<!-- 内容主体区域 -->
				<iframe name="mainFrame" id="mainFrame" src="" frameborder="0" style="width: 100%; height: 200px;" seamless></iframe>
			</div>
		</div>

		<div class="layui-footer">
			<!-- 底部固定区域 -->
			©admin
		</div>
	</div>
	<script src="/static/layui/layui.all.js"></script>
	<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script>
		$(function() {
			$("#mainFrame").css("height",
					(document.getElementById("main_body").offsetHeight * 0.97))
		})
		$("body").bind('resize',function(){
			$("#mainFrame").css("height",
					(document.getElementById("main_body").offsetHeight * 0.97))
		});
	</script>

</body>
</html>